//
//  BaseTestViewController.m
//  MyDemos
//
//  Created by iMac on 2018/3/8.
//  Copyright © 2018年 iMac. All rights reserved.
//

#import "BaseTestViewController.h"

@interface BaseTestViewController ()

@end

@implementation BaseTestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self addDismissButton];
}

- (void)addDismissButton {
    UIButton *dismiss = ({
        UIButton *btn = [[UIButton alloc] init];
        [btn setTitle:@"dismiss" forState:UIControlStateNormal];
        [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        CGFloat f = 100;
        btn.frame = CGRectMake(SCREEN_WIDTH - f, SCREEN_HEIGHT - f, f, f);
        [btn setBackgroundColor:[UIColor purpleColor]];
        [btn addTarget:self action:@selector(dismissButtonClick:) forControlEvents:UIControlEventTouchUpInside];
        btn;
    });
    [[UIApplication sharedApplication].delegate.window addSubview:dismiss];
}
- (void)dismissButtonClick:(UIButton *)sender {
    [self dismissViewControllerAnimated:true completion:nil];
}


- (void)dealloc {
    
    NSLog(@"====== %@, dealloc", NSStringFromClass(self.class));
}

@end
